package day1020;

interface Swim{
    void swim();
}



public class Test7Lam2 {
    public static void main(String[] args) {


        Swim s=new Swim(){
            public void swim(){
                System.out.println(1);
                System.out.println(2);
            }
        };







        //匿名类的方法参数保留，方法的代码保留， 两段代码之间添加一个   ->
        Swim s2=()->{
            System.out.println(1);
            System.out.println(2);
        };







    }
}
